from math import gcd
from typing import List


class Solution:
    def isGoodArray(self, nums: List[int]) -> bool:
        now = nums[0]
        for i in range(1, len(nums)):
            now = gcd(now, nums[i])
            if now == 1:
                return True
        return now == 1


if __name__ == "__main__":
    print(Solution().isGoodArray(nums=[12, 5, 7, 23]))  # True
    print(Solution().isGoodArray(nums=[29, 6, 10]))  # True
    print(Solution().isGoodArray(nums=[3, 6]))  # False
